package com.ly.pojo.dto;

import lombok.Data;
import jakarta.validation.constraints.NotNull;
import java.net.URL;
import jakarta.validation.constraints.Positive;
import jakarta.validation.constraints.NotBlank;
import io.swagger.v3.oas.annotations.media.Schema;

/**
 * 产品信息封装
 *
 * @author Administrator
 * @date 2025-03-07 10:51:13
 */
@Data
public class ProductDTO {

    /**
     * 产品ID:产品ID，必填
     */
    @NotNull(groups = { UpdateGroup.class, DeleteGroup.class }, message = "产品ID不能为空")
    @Schema(description = "产品ID:产品ID，必填")
    private Integer productId;

    /**
     * 产品名称:产品名称，必填
     */
    @NotBlank(groups = { CreateGroup.class }, message = "产品名称不能为空")
    @Schema(description = "产品名称:产品名称，必填")
    private String productName;

    /**
     * 产品描述:产品描述
     */
    @Schema(description = "产品描述:产品描述")
    private String description;

    /**
     * 产品价格:产品价格
     */
    @Positive(message = "产品价格必须为正数")
    @Schema(description = "产品价格:产品价格")
    private Double price;

    /**
     * 图片URL:图片URL
     */
    @Schema(description = "图片URL:图片URL")
    private String imageUrl;
}
